<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <div ng-app="routingDemoApp">
    <ul>
      <li><a href="#!/">首页</a></li>
      <li><a href="#!/computers">电脑</a></li>
      <li><a href="#!/printers">打印机</a></li>
      <li><a href="#!/blabla">其他</a></li>
    </ul>
    <div ng-view></div>
  </div>

  <script src="./static/angular.min.js"></script>
  <script src="./static/angular-route.min.js"></script>

  <script>
    angular.module('routingDemoApp', ['ngRoute'])
      .config(['$routeProvider', function ($routeProvider) {
        $routeProvider
          .when('/', { template: '这是首页页面' })
          .when('/computers', { template: '这是电脑分类页面' })
          .when('/printers', { template: '这是打印机页面' })
          .otherwise({ redirectTo: '/' });
      }]);
  </script>
</body>

</html>